home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
asm32.zip
/
E32.ZIP
/
INS_STR.ASM
< prev
next >
Wrap
Assembly Source File
|
1994-01-25
|
1KB
|
45 lines
; INS_STR.ASM for E32 - Copyright (C) 1994 Douglas Herr
; all rights reserved
include model.inc
public insert_string
extrn open_space:near
extrn locate:near
;
; insert_string inserts EAX characters from DS:ESI into the file
;
include dataseg.inc
extrn cursor:dword, cur_posn:word, dirty_bits:byte
@curseg ends
include codeseg.inc
insert_string proc near
push es
push esi ; save the string buffer
mov esi,cursor ; get cursor offset
push eax ; save length of string
push esi
call open_space ; returns with ES -> file_segment
pop edi ; get back cursor position
pop ecx ; get back string length
pop esi ; get back buffer pointer
jc short no_space ; if no space available, exit
rep movsb ; copy the characters into the space
mov esi,cursor ; get the new cursor offset
mov dx,cur_posn ; also get the current row
push ds
pop es
call locate ; adjust the screen position
or dirty_bits,1 ; screen needs update
no_space:
clc
pop es
ret
insert_string endp
@curseg ends
end